import { INCREMENT, DECREMENT } from '../constants';
const initState = 0;
const countReducer = (state = initState, action) => {
  // console.log('countReducer@', state, action);
  switch (action.type) {
    case INCREMENT:
      return state + action.data;

    case DECREMENT:
      return state - action.data;
    default:
      return state;
  }
};

export default countReducer;
